package com.meituan.catering.management.order.remote.impl;

import com.meituan.catering.management.common.model.api.thrift.UserContextThriftRequest;
import com.meituan.catering.management.common.remote.BaseThriftRemoteService;
import com.meituan.catering.management.order.remote.ShopRemoteService;
import com.meituan.catering.management.order.remote.model.converter.ShopRemoteConverter;
import com.meituan.catering.management.order.remote.model.response.ShopDetailRemoteResponse;
import com.meituan.catering.management.shop.api.thrift.model.response.ShopDetailThriftResponse;
import com.meituan.catering.management.shop.api.thrift.service.ShopThriftService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class ShopRemoteServiceImpl extends BaseThriftRemoteService implements ShopRemoteService {

    public ShopDetailRemoteResponse findByBusinessNo(UserContextThriftRequest request, String bno){

        ShopThriftService shopThriftService = super.buildConsoleThriftService(ShopThriftService.class, 9202);
        ShopDetailThriftResponse shopDetailThriftResponse = shopThriftService.findByBusinessNo(request, bno);
        /**
         * 转换
         */
        ShopDetailRemoteResponse shopDetailRemoteResponse = ShopRemoteConverter.fromShopThriftResponse(shopDetailThriftResponse);

        return shopDetailRemoteResponse;
    }
}
